package com.codeoss.framework.util;

import java.sql.Timestamp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.codeoss.module.ir.model.IrLoginLog;
import com.codeoss.module.ir.service.IIrLoginLogService;

@Component
public class LoginLogUtil {
	@Autowired
	private IIrLoginLogService irLoginLogService;
	public void logLogin() {
		IrLoginLog irLoginLog=new IrLoginLog();
		irLoginLog.setLoginTime(new Timestamp(System.currentTimeMillis()));
		irLoginLog.setLoginType("login");
		irLoginLogService.insert(irLoginLog);
	}
	
	public void logLogout() {
		IrLoginLog irLoginLog=new IrLoginLog();
		irLoginLog.setLoginTime(new Timestamp(System.currentTimeMillis()));
		irLoginLog.setLoginType("logout");
		irLoginLogService.insert(irLoginLog);
	}
}
